<!DOCTYPE html>
<html>
	{include file="public/header" /}
	<body>
		<div class="layui-form" lay-filter="layuiadmin-form-admin" id="layuiadmin-form-admin" style="padding: 20px 30px 0 0;">
			<div class="layui-form-item">
				<label class="layui-form-label">服务费收取方式</label>
				<div class="layui-input-inline">
					{eq name="data.fuwufeikaiguan" value="1"}
						<input type="checkbox" lay-filter="test" name="fuwufeikaiguan" lay-skin="switch" lay-text="先收取|后收取" checked> 
					{else/}
						<input type="checkbox" lay-filter="test" name="fuwufeikaiguan" lay-skin="switch" lay-text="先收取|后收取"> 
					{/eq}
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">借款金额</label>
				<div class="layui-input-inline">
					<input type="text" id="money" name="SalePrice" lay-verify="required" placeholder="" autocomplete="off" class="layui-input" value="{$data.SalePrice}">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">服务费</label>
				<div class="layui-input-inline">
					<input type="text" id="fuwufei" name="GuanliCost" placeholder="" autocomplete="off" class="layui-input" value="{$data.GuanliCost}">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">到账金额</label>
				<div class="layui-input-inline">
					<input type="text" id="daozhang_money" name="daozhang" disabled lay-verify="required" placeholder="" autocomplete="off" class="layui-input" value="{$data.daozhang}">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">借款周期</label>
				<div class="layui-input-inline">
					<input type="text" name="jiekuandays" lay-verify="required" placeholder="" autocomplete="off" class="layui-input" value="{$data.jiekuandays}">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">还款次数</label>
				<div class="layui-input-inline">
					<input type="text" name="huankuan_nums" lay-verify="required" placeholder="" autocomplete="off" class="layui-input" value="{$data.huankuan_nums}">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">到期应还</label>
				<div class="layui-input-inline">
					<input type="text" name="daoqiyinghua" id="daoqiyinghua" disabled placeholder="" autocomplete="off" class="layui-input" value="{$data.daoqiyinghua}">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">展期费</label>
				<div class="layui-input-inline">
					<input type="text" name="zhanqifei" id="zhanqifei" placeholder="" autocomplete="off" class="layui-input" value="{$data.zhanqifei}">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">正常客户展期开关</label>
				<div class="layui-input-inline">
					{eq name="data.Status" value="1"}
					<input type="checkbox" lay-filter="switch" name="Status" lay-skin="switch" lay-text="启用|禁用" checked> {else/}
					<input type="checkbox" lay-filter="switch" name="Status" lay-skin="switch" lay-text="启用|禁用"> {/eq}
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">逾期客户展期开关</label>
				<div class="layui-input-inline">
					{eq name="data.Statusyuqi" value="1"}
					<input type="checkbox" lay-filter="switch" name="Statusyuqi" lay-skin="switch" lay-text="启用|禁用" checked> {else/}
					<input type="checkbox" lay-filter="switch" name="Statusyuqi" lay-skin="switch" lay-text="启用|禁用"> {/eq}
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">上架开关</label>
				<div class="layui-input-inline">
					{eq name="data.IsShelves" value="1"}
					<input type="checkbox" lay-filter="switch" name="IsShelves" lay-skin="switch" lay-text="启用|禁用" checked> {else/}
					<input type="checkbox" lay-filter="switch" name="IsShelves" lay-skin="switch" lay-text="启用|禁用"> {/eq}
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">产品类型开关</label>
				<div class="layui-input-inline">
					{eq name="data.defont" value="2"}
					<input type="checkbox" lay-filter="switch" name="defont" lay-skin="switch" lay-text="正常|默认" checked> {else/}
					<input type="checkbox" lay-filter="switch" name="defont" lay-skin="switch" lay-text="正常|默认"> {/eq}
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">年化利率(%)：</label>
				<div class="layui-input-inline">
					<input type="text" name="nianhualilv" lay-verify="required" placeholder="" autocomplete="off" class="layui-input" value="{$data.nianhualilv}">
				</div>
			</div>

			<div class="layui-form-item">
				<p style="color: red;left: 120px;">罚金=逾期利率*到账金额*逾期天数</p>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">逾期利率(%)</label>
				<div class="layui-input-inline">
					<input type="text" name="yuqulv" lay-verify="required" placeholder="" autocomplete="off" class="layui-input" value="{$data.yuqulv}">
				</div>
			</div>
			<input type="hidden" name="ID" lay-verify="required" placeholder="隐藏域 编辑用户ID" autocomplete="off" class="layui-input" value="{$data.ID}">
			<div class="layui-form-item layui-hide">
				<button class="layui-btn" lay-submit lay-filter="LAY-user-back-submit" id="LAY-user-back-submit">提交</button>
			</div>
		</div>
		<!--<script src="../../../layuiadmin/layui/layui.js"></script>-->
		{include file="public/footer" /}
		<script>
			layui.use(['form'], function() {
				var form = layui.form;
				$("#fuwufei").change(function() {
					var abc = $('input[name=fuwufeikaiguan]:checked').val();
					if(abc == 'on') {
						//			先收取 
							var money = $("#money").val();
							var fuwufei = $(this).val();
							var daozhang_money = money - fuwufei;
							$("#daozhang_money").val(daozhang_money); //到账金额 =本金减去服务费
							$("#daoqiyinghua").val(money);
							$("#zhanqifei").val(fuwufei);
						
					} else {
						//后收取
							var fuwufeikaiguan = $("#fuwufeikaiguan").val();
							var money = $("#money").val();
							var fuwufei = $(this).val();
							var daozhang_money = Number(money) + Number(fuwufei); //到期应还  =本金加+服务费
							$("#daozhang_money").val(money);
							$("#daoqiyinghua").val(daozhang_money);
							$("#zhanqifei").val(fuwufei);
					}
				})
				form.on('switch(test)', function(data) {
					$str='';
					$("#fuwufei").val($str); 
					
				});
			})
		</script>
	</body>

</html>